﻿using DoNet.Core.Models;
using SqlSugar;

namespace DoNet.System.Models
{
    /// <summary>
    /// SysAccessToken
    /// </summary>
    [SugarTable("Sys_Token", "Token表")]
    [Serializable]
    public class Token : TenantEntity, ICreationAudited, IModificationAudited
    {
        /// <summary>
        /// 
        /// </summary>
        public string AppId { get; set; } = string.Empty;
        /// <summary>
        /// 令牌
        /// </summary>
        public string AccessToken { get; set; } = string.Empty;
        /// <summary>
        /// 令牌过期时长（分钟）
        /// </summary>
        public int AccessExpires { get; set; }
        /// <summary>
        /// AccessToken过期时间
        /// </summary>
        public DateTime AccessExpiresDate { get; set; }
        /// <summary>
        /// 刷新令牌
        /// </summary>
        public string RefreshToken { get; set; } = string.Empty;
        /// <summary>
        /// 刷新令牌过期时长（天）
        /// </summary>
        public int RefreshExpires { get; set; }
        /// <summary>
        /// RefreshToken过期时间
        /// </summary>
        public DateTime RefreshExpiresDate { get; set; }
        /// <summary>
        /// 是否吊销
        /// </summary>
        public bool IsRevoked { get; set; }
        /// <summary>
        /// 获取或设置 创建用户主键
        /// </summary>
        public long? CreatorUserId { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatorTime { get; set; }
        /// <summary>
        /// 最后修改用户
        /// </summary>
        public long? LastModifyUserId { get; set; }
        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime? LastModifyTime { get; set; }
    }
}
